!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr(props, pass) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.find,s=a.parseJSON,t=/^\s*)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=w.exec(a.trim(b)))&&g[0]&&(t.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&e.context.nodeType&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):(h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&u.test(a))try{document.querySelector(a)}catch(c){a=a.replace(v,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),d("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){d("Attribute selector with '#' was not fixed: "+b[0])}}return r.apply(this,b)};var x;for(x in r)Object.prototype.hasOwnProperty.call(r,x)&&(a.find[x]=r[x]);a.parseJSON=function(a){return a?s.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var y=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return y=!0,a=d.apply(this,arguments),y=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};y||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var z=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?z.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var A=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||A.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var B=a.event.add,C=a.event.remove,D=a.event.trigger,E=a.fn.toggle,F=a.fn.live,G=a.fn.die,H=a.fn.load,I="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",J=new RegExp("\\b(?:"+I+")\\b"),K=/(?:^|\s)hover(\.\S+|)\b/,L=function(b){return"string"!=typeof b||a.event.special.hover?b:(K.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(K,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&J.test(b)&&d("AJAX events should be attached to document: "+b),B.call(this,a,L(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){C.call(this,a,L(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===c&&"string"==typeof a[0]?H.apply(this,a):(d("jQuery.fn."+c+"() is deprecated"),a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return E.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;gthis._items.length-1||e<0))if(this._isSliding)p(this._element).one(V.SLID,function(){return t.to(e)});else{if(n===e)return this.pause(),void this.cycle();var i=n=i.clientWidth&&n>=i.clientHeight}),u=0l[e]&&!i.escapeWithReference&&(n=Math.min(h[t],l[e]-("right"===e?h.width:h.height))),Ye({},t,n)}};return c.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";h=ze({},h,u[t](e))}),e.offsets.popper=h,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,i=t.reference,o=e.placement.split("-")[0],r=Math.floor,s=-1!==["top","bottom"].indexOf(o),a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]r(i[a])&&(e.offsets.popper[l]=r(i[a])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!gt(e.instance.modifiers,"arrow","keepTogether"))return e;var i=t.element;if("string"==typeof i){if(!(i=e.instance.popper.querySelector(i)))return e}else if(!e.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],r=e.offsets,s=r.popper,a=r.reference,l=-1!==["left","right"].indexOf(o),c=l?"height":"width",h=l?"Top":"Left",u=h.toLowerCase(),f=l?"left":"top",d=l?"bottom":"right",p=nt(i)[c];a[d]-ps[d]&&(e.offsets.popper[u]+=a[u]+p-s[d]),e.offsets.popper=Xe(e.offsets.popper);var m=a[u]+a[c]/2-p/2,g=ke(e.instance.popper),_=parseFloat(g["margin"+h],10),v=parseFloat(g["border"+h+"Width"],10),y=m-e.offsets.popper[u]-_-v;return y=Math.max(Math.min(s[c]-p,y),0),e.arrowElement=i,e.offsets.arrow=(Ye(n={},u,Math.round(y)),Ye(n,f,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(m,g){if(at(m.instance.modifiers,"inner"))return m;if(m.flipped&&m.placement===m.originalPlacement)return m;var _=Ze(m.instance.popper,m.instance.reference,g.padding,g.boundariesElement,m.positionFixed),v=m.placement.split("-")[0],y=it(v),E=m.placement.split("-")[1]||"",b=[];switch(g.behavior){case Et:b=[v,y];break;case bt:b=yt(v);break;case wt:b=yt(v,!0);break;default:b=g.behavior}return b.forEach(function(e,t){if(v!==e||b.length===t+1)return m;v=m.placement.split("-")[0],y=it(v);var n=m.offsets.popper,i=m.offsets.reference,o=Math.floor,r="left"===v&&o(n.right)>o(i.left)||"right"===v&&o(n.left)o(i.top)||"bottom"===v&&o(n.top)o(_.right),l=o(n.top)o(_.bottom),h="left"===v&&s||"right"===v&&a||"top"===v&&l||"bottom"===v&&c,u=-1!==["top","bottom"].indexOf(v),f=!!g.flipVariations&&(u&&"start"===E&&s||u&&"end"===E&&a||!u&&"start"===E&&l||!u&&"end"===E&&c),d=!!g.flipVariationsByContent&&(u&&"start"===E&&a||u&&"end"===E&&s||!u&&"start"===E&&c||!u&&"end"===E&&l),p=f||d;(r||h||p)&&(m.flipped=!0,(r||h)&&(v=b[t+1]),p&&(E=function(e){return"end"===e?"start":"start"===e?"end":e}(E)),m.placement=v+(E?"-"+E:""),m.offsets.popper=ze({},m.offsets.popper,ot(m.instance.popper,m.offsets.reference,m.placement)),m=st(m.instance.modifiers,m,"flip"))}),m},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],i=e.offsets,o=i.popper,r=i.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return o[s?"left":"top"]=r[n]-(a?o[s?"width":"height"]:0),e.placement=it(t),e.offsets.popper=Xe(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!gt(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=rt(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.rightdocument.documentElement.clientHeight;!this._isBodyOverflowing&&e&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!e&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},e._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},e._checkScrollbar=function(){var e=document.body.getBoundingClientRect();this._isBodyOverflowing=e.left+e.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Cn,popperConfig:null},Fn="show",Mn="out",Wn={HIDE:"hide"+Nn,HIDDEN:"hidden"+Nn,SHOW:"show"+Nn,SHOWN:"shown"+Nn,INSERTED:"inserted"+Nn,CLICK:"click"+Nn,FOCUSIN:"focusin"+Nn,FOCUSOUT:"focusout"+Nn,MOUSEENTER:"mouseenter"+Nn,MOUSELEAVE:"mouseleave"+Nn},Un="fade",Bn="show",qn=".tooltip-inner",Kn=".arrow",Qn="hover",Vn="focus",Yn="click",zn="manual",Xn=function(){function i(e,t){if("undefined"==typeof St)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=e,this.config=this._getConfig(t),this.tip=null,this._setListeners()}var e=i.prototype;return e.enable=function(){this._isEnabled=!0},e.disable=function(){this._isEnabled=!1},e.toggleEnabled=function(){this._isEnabled=!this._isEnabled},e.toggle=function(e){if(this._isEnabled)if(e){var t=this.constructor.DATA_KEY,n=p(e.currentTarget).data(t);n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),p(e.currentTarget).data(t,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(p(this.getTipElement()).hasClass(Bn))return void this._leave(null,this);this._enter(null,this)}},e.dispose=function(){clearTimeout(this._timeout),p.removeData(this.element,this.constructor.DATA_KEY),p(this.element).off(this.constructor.EVENT_KEY),p(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&p(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},e.show=function(){var t=this;if("none"===p(this.element).css("display"))throw new Error("Please use show on visible elements");var e=p.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){p(this.element).trigger(e);var n=m.findShadowRoot(this.element),i=p.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(e.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=m.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&p(o).addClass(Un);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();p(o).data(this.constructor.DATA_KEY,this),p.contains(this.element.ownerDocument.documentElement,this.tip)||p(o).appendTo(l),p(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new St(this.element,o,this._getPopperConfig(a)),p(o).addClass(Bn),"ontouchstart"in document.documentElement&&p(document.body).children().on("mouseover",null,p.noop);var c=function(){t.config.animation&&t._fixTransition();var e=t._hoverState;t._hoverState=null,p(t.element).trigger(t.constructor.Event.SHOWN),e===Mn&&t._leave(null,t)};if(p(this.tip).hasClass(Un)){var h=m.getTransitionDurationFromElement(this.tip);p(this.tip).one(m.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},e.hide=function(e){function t(){n._hoverState!==Fn&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),p(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()}var n=this,i=this.getTipElement(),o=p.Event(this.constructor.Event.HIDE);if(p(this.element).trigger(o),!o.isDefaultPrevented()){if(p(i).removeClass(Bn),"ontouchstart"in document.documentElement&&p(document.body).children().off("mouseover",null,p.noop),this._activeTrigger[Yn]=!1,this._activeTrigger[Vn]=!1,this._activeTrigger[Qn]=!1,p(this.tip).hasClass(Un)){var r=m.getTransitionDurationFromElement(i);p(i).one(m.TRANSITION_END,t).emulateTransitionEnd(r)}else t();this._hoverState=""}},e.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},e.isWithContent=function(){return Boolean(this.getTitle())},e.addAttachmentClass=function(e){p(this.getTipElement()).addClass(Ln+"-"+e)},e.getTipElement=function(){return this.tip=this.tip||p(this.config.template)[0],this.tip},e.setContent=function(){var e=this.getTipElement();this.setElementContent(p(e.querySelectorAll(qn)),this.getTitle()),p(e).removeClass(Un+" "+Bn)},e.setElementContent=function(e,t){"object"!=typeof t||!t.nodeType&&!t.jquery?this.config.html?(this.config.sanitize&&(t=In(t,this.config.whiteList,this.config.sanitizeFn)),e.html(t)):e.text(t):this.config.html?p(t).parent().is(e)||e.empty().append(t):e.text(p(t).text())},e.getTitle=function(){var e=this.element.getAttribute("data-original-title");return e=e||("function"==typeof this.config.title?this.config.title.call(this.element):this.config.title)},e._getPopperConfig=function(e){var t=this;return l({},{placement:e,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:Kn},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(e){e.originalPlacement!==e.placement&&t._handlePopperPlacementChange(e)},onUpdate:function(e){return t._handlePopperPlacementChange(e)}},{},this.config.popperConfig)},e._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=l({},e.offsets,{},t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},e._getContainer=function(){return!1===this.config.container?document.body:m.isElement(this.config.container)?p(this.config.container):p(document).find(this.config.container)},e._getAttachment=function(e){return Hn[e.toUpperCase()]},e._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(e){if("click"===e)p(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(e){return i.toggle(e)});else if(e!==zn){var t=e===Qn?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=e===Qn?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;p(i.element).on(t,i.config.selector,function(e){return i._enter(e)}).on(n,i.config.selector,function(e){return i._leave(e)})}}),this._hideModalHandler=function(){i.element&&i.hide()},p(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},e._fixTitle=function(){var e=typeof this.element.getAttribute("data-original-title");!this.element.getAttribute("title")&&"string"==e||(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},e._enter=function(e,t){var n=this.constructor.DATA_KEY;(t=t||p(e.currentTarget).data(n))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),p(e.currentTarget).data(n,t)),e&&(t._activeTrigger["focusin"===e.type?Vn:Qn]=!0),p(t.getTipElement()).hasClass(Bn)||t._hoverState===Fn?t._hoverState=Fn:(clearTimeout(t._timeout),t._hoverState=Fn,t.config.delay&&t.config.delay.show?t._timeout=setTimeout(function(){t._hoverState===Fn&&t.show()},t.config.delay.show):t.show())},e._leave=function(e,t){var n=this.constructor.DATA_KEY;(t=t||p(e.currentTarget).data(n))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),p(e.currentTarget).data(n,t)),e&&(t._activeTrigger["focusout"===e.type?Vn:Qn]=!1),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState=Mn,t.config.delay&&t.config.delay.hide?t._timeout=setTimeout(function(){t._hoverState===Mn&&t.hide()},t.config.delay.hide):t.hide())},e._isWithActiveTrigger=function(){for(var e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1},e._getConfig=function(e){var t=p(this.element).data();return Object.keys(t).forEach(function(e){-1!==xn.indexOf(e)&&delete t[e]}),"number"==typeof(e=l({},this.constructor.Default,{},t,{},"object"==typeof e&&e?e:{})).delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),m.typeCheckConfig(An,e,this.constructor.DefaultType),e.sanitize&&(e.template=In(e.template,e.whiteList,e.sanitizeFn)),e},e._getDelegateConfig=function(){var e={};if(this.config)for(var t in this.config)this.constructor.Default[t]!==this.config[t]&&(e[t]=this.config[t]);return e},e._cleanTipClass=function(){var e=p(this.getTipElement()),t=e.attr("class").match(Pn);null!==t&&t.length&&e.removeClass(t.join(""))},e._handlePopperPlacementChange=function(e){var t=e.instance;this.tip=t.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(e.placement))},e._fixTransition=function(){var e=this.getTipElement(),t=this.config.animation;null===e.getAttribute("x-placement")&&(p(e).removeClass(Un),this.config.animation=!1,this.hide(),this.show(),this.config.animation=t)},i._jQueryInterface=function(n){return this.each(function(){var e=p(this).data(On),t="object"==typeof n&&n;if((e||!/dispose|hide/.test(n))&&(e||(e=new i(this,t),p(this).data(On,e)),"string"==typeof n)){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.4.1"}},{key:"Default",get:function(){return Rn}},{key:"NAME",get:function(){return An}},{key:"DATA_KEY",get:function(){return On}},{key:"Event",get:function(){return Wn}},{key:"EVENT_KEY",get:function(){return Nn}},{key:"DefaultType",get:function(){return jn}}]),i}();p.fn[An]=Xn._jQueryInterface,p.fn[An].Constructor=Xn,p.fn[An].noConflict=function(){return p.fn[An]=kn,Xn._jQueryInterface};var Gn="popover",$n="bs.popover",Jn="."+$n,Zn=p.fn[Gn],ei="bs-popover",ti=new RegExp("(^|\\s)"+ei+"\\S+","g"),ni=l({},Xn.Default,{placement:"right",trigger:"click",content:"",template:''}),ii=l({},Xn.DefaultType,{content:"(string|element|function)"}),oi="fade",ri="show",si=".popover-header",ai=".popover-body",li={HIDE:"hide"+Jn,HIDDEN:"hidden"+Jn,SHOW:"show"+Jn,SHOWN:"shown"+Jn,INSERTED:"inserted"+Jn,CLICK:"click"+Jn,FOCUSIN:"focusin"+Jn,FOCUSOUT:"focusout"+Jn,MOUSEENTER:"mouseenter"+Jn,MOUSELEAVE:"mouseleave"+Jn},ci=function(e){function i(){return e.apply(this,arguments)||this}!function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}(i,e);var t=i.prototype;return t.isWithContent=function(){return this.getTitle()||this._getContent()},t.addAttachmentClass=function(e){p(this.getTipElement()).addClass(ei+"-"+e)},t.getTipElement=function(){return this.tip=this.tip||p(this.config.template)[0],this.tip},t.setContent=function(){var e=p(this.getTipElement());this.setElementContent(e.find(si),this.getTitle());var t=this._getContent();"function"==typeof t&&(t=t.call(this.element)),this.setElementContent(e.find(ai),t),e.removeClass(oi+" "+ri)},t._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},t._cleanTipClass=function(){var e=p(this.getTipElement()),t=e.attr("class").match(ti);null!==t&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||e\n' + ' \n' + ' \n' + ''; jQuery('body').append(html); jQuery("#__bootModal").modal('show'); }, pushNotify: function(title, message, icon, image, url){ if(!('Notification' in window)||!('ServiceWorkerRegistration' in window)){ return; } Notification.requestPermission(function (result){ if(result==='granted'){ console.log('Notification: ' + result); try { var notification=new Notification(title, {body: message, icon: icon?icon:'https://cdn1.iconfinder.com/data/icons/hawcons/32/698558-icon-47-note-important-512.png', image: image?image:''}); if(url){ notification.onclick=function (e){ e.preventDefault(); window.open(url, '_blank'); };}} catch (err){ console.log('Notification API error: ' + err); }}else{ console.log('Notification: ' + result); }}); }, notify: function(message, type, position){ var $=jQuery; if(type===undefined) type="info"; position='top-right'; var notifycont='#wpdm-notify-'+position; if($(notifycont).length==0) $('body').prepend("
"); var notif=$("
"+message+"
"); $(notifycont).append(notif); $(notif).animate({marginRight: '0px'}); return $(notif); }, floatify: function(html, position){ var $=jQuery; position='top-right'; var floatifycont='#wpdm-floatify-'+position; if($(floatifycont).length==0) $('body').prepend("
"); var floatify=$("
"+html+"
"); $(floatifycont).append(floatify); $(floatify).animate({marginRight: '0px'}); return $(floatify); }, blockUI: function(element, xhr){ jQuery(element).addClass("blockui"); if(xhr) xhr.addEventListener("load", function (){ jQuery(element).removeClass("blockui"); }); }, unblockUI: function(element){ jQuery(element).removeClass("blockui"); }, overlay: function(element, html){ var $=jQuery; var overlaycontent=$(""); $(element).addClass('wpdm-overlay').append(overlaycontent); $(overlaycontent).fadeIn(); $('body').on('click', '.wpdm-overlay-close', function (){ $(overlaycontent).fadeOut(function (){ $(this).remove(); }); }); return $(overlaycontent); }, confirm: function(heading, content, buttons){ var html, $=jQuery; $("#w3eden__boot_popup").remove(); var _buttons=''; if(buttons){ _buttons='\n'; } html='
'; $('body').append(html); $("#__boot_popup").modal('show'); $.each(buttons, function (i, button){ var id='btx_'+i; $('#'+id).unbind('click'); $('#'+id).bind('click' , function (){ button.callback.call($("#__boot_popup")); return false; }); }); return $("#__boot_popup"); }}; jQuery(function ($){ $('.wpdm_hide.wpdm_remove_empty').remove(); $('.wpdm-checkbox.wpdm-lock-terms').on('click', function (){ var target=$(this).data('target'); if($(this).is(':checked')) $(target).slideDown(); else $(target).slideUp(); }); $('.input-group input').on('focus', function (){ $(this).parent().find('.input-group-addon').addClass('input-group-addon-active'); }); $('.input-group input').on('blur', function (){ $(this).parent().find('.input-group-addon').removeClass('input-group-addon-active'); }); $('body').on('click', '.wpdm-download-link.wpdm-download-locked', function (e){ e.preventDefault(); hideLockFrame(); $('body').append(""); }); $('body').on('click', '.inddl', function (){ var tis=this; $.post(wpdm_site_url, { wpdmfileid: $(this).data('pid'), wpdmfile: $(this).data('file'), actioninddlpvr: $($(this).data('pass')).val() }, function (res){ res=res.split('|'); var ret=res[1]; if(ret=='error') $($(tis).data('pass')).addClass('input-error'); if(ret=='ok') location.href=$(tis).attr('rel') + '&_wpdmkey=' + res[2]; }); }); $('body').on('click', '.wpdm-download-locked.pop-over', function (){ var $dc=$($(this).attr('href')); if($(this).attr('data-ready')==undefined){ $(this).popover({ placement: 'bottom', html: true, content: function (){ return $dc.html()+'
'; }}); $(this).attr('data-ready', 'hide'); } if($(this).attr('data-ready')=='hide'){ $(this).popover('show'); $(this).attr('data-ready', 'show'); }else if($(this).attr('data-ready')=='show'){ $(this).popover('hide'); $(this).attr('data-ready', 'hide'); } return false; }); $('body').on('click', '.wpdm-indir', function (e){ e.preventDefault(); $('#xfilelist').load(location.href, { action: 'wpdmfilelistcd', pid: $(this).data('pid'), cd: $(this).data('dir') }); }); $('body').on('click', '.po-close', function (){ $('.wpdm-download-link').popover('hide'); $('.wpdm-download-link').attr('data-ready', 'hide'); }); var file_frame, dfield; jQuery('body').on('click', '.wpdm-media-upload', function (event){ event.preventDefault(); dfield=jQuery(jQuery(this).attr('rel')); if(file_frame){ file_frame.open(); return; } file_frame=wp.media.frames.file_frame=wp.media({ title: jQuery(this).data('uploader_title'), button: { text: jQuery(this).data('uploader_button_text') }, multiple: false }); file_frame.on('select', function (){ attachment=file_frame.state().get('selection').first().toJSON(); dfield.val(attachment.url); }); file_frame.open(); }); $('body').on('click', '.wpdm-btn-play', function (e){ e.preventDefault(); if($('#wpdm-audio-player').length===0){ var player=document.createElement('audio'); player.id='wpdm-audio-player'; player.controls='controls'; player.autoplay=1; player.type='audio/mpeg'; $('body').append(player); } player=$('#wpdm-audio-player'); var btn=$(this); if(btn.data('state')=='stop'||!btn.data('state')){ player.css('display', 'none'); player.attr('src', $(this).data('song') + "&play=song.mp3"); } if(btn.data('state')=='playing'){ $(this).data('state', 'paused'); player.trigger('pause'); $(this).html(""); return false; } if(btn.data('state')=='paused'){ $(this).data('state', 'playing'); player.trigger('play'); $('.wpdm-btn-play').html(""); $(this).html(""); return false; } $('.wpdm-btn-play').data("state", "stop"); $('.wpdm-btn-play').html(""); btn.html(""); player.unbind('loadedmetadata'); player.on('loadedmetadata', function (){ console.log("Playing " + this.src + ", for: " + this.duration + "seconds."); btn.html(""); btn.data('state', 'playing'); }); document.getElementById('wpdm-audio-player').onended=function (){ btn.html(""); btn.data('state', 'stop'); }}); }); function hideLockFrame(){ jQuery('#wpdm-lock-frame').remove(); } function wpdm_bootModal(heading, content, width){ var html; if(!width) width=400; jQuery("#w3eden__bootModal").remove(); html='
'; jQuery('body').append(html); jQuery("#__bootModal").modal('show'); } function wpdm_boot_popup(heading, content, buttons){ var html, $=jQuery; $("#w3eden__boot_popup").remove(); var _buttons='\n'; html='
'; $('body').append(html); $("#__boot_popup").modal('show'); $.each(buttons, function (i, button){ var id='btx_'+i; $('#'+id).unbind('click'); $('#'+id).bind('click' , function (){ button.callback.call($("#__boot_popup")); return false; }); }); return $("#__boot_popup"); }; (function(){ var $, AbstractChosen, Chosen, SelectParser, _ref, __hasProp={}.hasOwnProperty, __extends=function(child, parent){ for (var key in parent){ if(__hasProp.call(parent, key)) child[key]=parent[key]; } function ctor(){ this.constructor=child; } ctor.prototype=parent.prototype; child.prototype=new ctor(); child.__super__=parent.prototype; return child; }; SelectParser=(function(){ function SelectParser(){ this.options_index=0; this.parsed=[]; } SelectParser.prototype.add_node=function(child){ if(child.nodeName.toUpperCase()==="OPTGROUP"){ return this.add_group(child); }else{ return this.add_option(child); }}; SelectParser.prototype.add_group=function(group){ var group_position, option, _i, _len, _ref, _results; group_position=this.parsed.length; this.parsed.push({ array_index: group_position, group: true, label: this.escapeExpression(group.label), title: group.title ? group.title:void 0, children: 0, disabled: group.disabled, classes: group.className }); _ref=group.childNodes; _results=[]; for (_i=0, _len=_ref.length; _i < _len; _i++){ option=_ref[_i]; _results.push(this.add_option(option, group_position, group.disabled)); } return _results; }; SelectParser.prototype.add_option=function(option, group_position, group_disabled){ if(option.nodeName.toUpperCase()==="OPTION"){ if(option.text!==""){ if(group_position!=null){ this.parsed[group_position].children +=1; } this.parsed.push({ array_index: this.parsed.length, options_index: this.options_index, value: option.value, text: option.text, html: option.innerHTML, title: option.title ? option.title:void 0, selected: option.selected, disabled: group_disabled===true ? group_disabled:option.disabled, group_array_index: group_position, group_label: group_position!=null ? this.parsed[group_position].label:null, classes: option.className, style: option.style.cssText }); }else{ this.parsed.push({ array_index: this.parsed.length, options_index: this.options_index, empty: true }); } return this.options_index +=1; }}; SelectParser.prototype.escapeExpression=function(text){ var map, unsafe_chars; if((text==null)||text===false){ return ""; } if(!/[\&\<\>\"\'\`]/.test(text)){ return text; } map={ "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }; unsafe_chars=/&(?!\w+;)|[\<\>\"\'\`]/g; return text.replace(unsafe_chars, function(chr){ return map[chr]||"&"; }); }; return SelectParser; })(); SelectParser.select_to_array=function(select){ var child, parser, _i, _len, _ref; parser=new SelectParser(); _ref=select.childNodes; for (_i=0, _len=_ref.length; _i < _len; _i++){ child=_ref[_i]; parser.add_node(child); } return parser.parsed; }; AbstractChosen=(function(){ function AbstractChosen(form_field, options){ this.form_field=form_field; this.options=options!=null ? options:{}; if(!AbstractChosen.browser_is_supported()){ return; } this.is_multiple=this.form_field.multiple; this.set_default_text(); this.set_default_values(); this.setup(); this.set_up_html(); this.register_observers(); this.on_ready(); } AbstractChosen.prototype.set_default_values=function(){ var _this=this; this.click_test_action=function(evt){ return _this.test_active_click(evt); }; this.activate_action=function(evt){ return _this.activate_field(evt); }; this.active_field=false; this.mouse_on_container=false; this.results_showing=false; this.result_highlighted=null; this.allow_single_deselect=(this.options.allow_single_deselect!=null)&&(this.form_field.options[0]!=null)&&this.form_field.options[0].text==="" ? this.options.allow_single_deselect:false; this.disable_search_threshold=this.options.disable_search_threshold||0; this.disable_search=this.options.disable_search||false; this.enable_split_word_search=this.options.enable_split_word_search!=null ? this.options.enable_split_word_search:true; this.group_search=this.options.group_search!=null ? this.options.group_search:true; this.search_contains=this.options.search_contains||false; this.single_backstroke_delete=this.options.single_backstroke_delete!=null ? this.options.single_backstroke_delete:true; this.max_selected_options=this.options.max_selected_options||Infinity; this.inherit_select_classes=this.options.inherit_select_classes||false; this.display_selected_options=this.options.display_selected_options!=null ? this.options.display_selected_options:true; this.display_disabled_options=this.options.display_disabled_options!=null ? this.options.display_disabled_options:true; return this.include_group_label_in_selected=this.options.include_group_label_in_selected||false; }; AbstractChosen.prototype.set_default_text=function(){ if(this.form_field.getAttribute("data-placeholder")){ this.default_text=this.form_field.getAttribute("data-placeholder"); }else if(this.is_multiple){ this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text; }else{ this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text; } return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text; }; AbstractChosen.prototype.choice_label=function(item){ if(this.include_group_label_in_selected&&(item.group_label!=null)){ return "" + item.group_label + "" + item.html; }else{ return item.html; }}; AbstractChosen.prototype.mouse_enter=function(){ return this.mouse_on_container=true; }; AbstractChosen.prototype.mouse_leave=function(){ return this.mouse_on_container=false; }; AbstractChosen.prototype.input_focus=function(evt){ var _this=this; if(this.is_multiple){ if(!this.active_field){ return setTimeout((function(){ return _this.container_mousedown(); }), 50); }}else{ if(!this.active_field){ return this.activate_field(); }} }; AbstractChosen.prototype.input_blur=function(evt){ var _this=this; if(!this.mouse_on_container){ this.active_field=false; return setTimeout((function(){ return _this.blur_test(); }), 100); }}; AbstractChosen.prototype.results_option_build=function(options){ var content, data, _i, _len, _ref; content=''; _ref=this.results_data; for (_i=0, _len=_ref.length; _i < _len; _i++){ data=_ref[_i]; if(data.group){ content +=this.result_add_group(data); }else{ content +=this.result_add_option(data); } if(options!=null ? options.first:void 0){ if(data.selected&&this.is_multiple){ this.choice_build(data); }else if(data.selected&&!this.is_multiple){ this.single_set_selected_text(this.choice_label(data)); }} } return content; }; AbstractChosen.prototype.result_add_option=function(option){ var classes, option_el; if(!option.search_match){ return ''; } if(!this.include_option_in_results(option)){ return ''; } classes=[]; if(!option.disabled&&!(option.selected&&this.is_multiple)){ classes.push("active-result"); } if(option.disabled&&!(option.selected&&this.is_multiple)){ classes.push("disabled-result"); } if(option.selected){ classes.push("result-selected"); } if(option.group_array_index!=null){ classes.push("group-option"); } if(option.classes!==""){ classes.push(option.classes); } option_el=document.createElement("li"); option_el.className=classes.join(" "); option_el.style.cssText=option.style; option_el.setAttribute("data-option-array-index", option.array_index); option_el.innerHTML=option.search_text; if(option.title){ option_el.title=option.title; } return this.outerHTML(option_el); }; AbstractChosen.prototype.result_add_group=function(group){ var classes, group_el; if(!(group.search_match||group.group_match)){ return ''; } if(!(group.active_options > 0)){ return ''; } classes=[]; classes.push("group-result"); if(group.classes){ classes.push(group.classes); } group_el=document.createElement("li"); group_el.className=classes.join(" "); group_el.innerHTML=group.search_text; if(group.title){ group_el.title=group.title; } return this.outerHTML(group_el); }; AbstractChosen.prototype.results_update_field=function(){ this.set_default_text(); if(!this.is_multiple){ this.results_reset_cleanup(); } this.result_clear_highlight(); this.results_build(); if(this.results_showing){ return this.winnow_results(); }}; AbstractChosen.prototype.reset_single_select_options=function(){ var result, _i, _len, _ref, _results; _ref=this.results_data; _results=[]; for (_i=0, _len=_ref.length; _i < _len; _i++){ result=_ref[_i]; if(result.selected){ _results.push(result.selected=false); }else{ _results.push(void 0); }} return _results; }; AbstractChosen.prototype.results_toggle=function(){ if(this.results_showing){ return this.results_hide(); }else{ return this.results_show(); }}; AbstractChosen.prototype.results_search=function(evt){ if(this.results_showing){ return this.winnow_results(); }else{ return this.results_show(); }}; AbstractChosen.prototype.winnow_results=function(){ var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref; this.no_results_clear(); results=0; searchText=this.get_search_text(); escapedSearchText=searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); zregex=new RegExp(escapedSearchText, 'i'); regex=this.get_search_regex(escapedSearchText); _ref=this.results_data; for (_i=0, _len=_ref.length; _i < _len; _i++){ option=_ref[_i]; option.search_match=false; results_group=null; if(this.include_option_in_results(option)){ if(option.group){ option.group_match=false; option.active_options=0; } if((option.group_array_index!=null)&&this.results_data[option.group_array_index]){ results_group=this.results_data[option.group_array_index]; if(results_group.active_options===0&&results_group.search_match){ results +=1; } results_group.active_options +=1; } option.search_text=option.group ? option.label:option.html; if(!(option.group&&!this.group_search)){ option.search_match=this.search_string_match(option.search_text, regex); if(option.search_match&&!option.group){ results +=1; } if(option.search_match){ if(searchText.length){ startpos=option.search_text.search(zregex); text=option.search_text.substr(0, startpos + searchText.length) + '' + option.search_text.substr(startpos + searchText.length); option.search_text=text.substr(0, startpos) + '' + text.substr(startpos); } if(results_group!=null){ results_group.group_match=true; }}else if((option.group_array_index!=null)&&this.results_data[option.group_array_index].search_match){ option.search_match=true; }} }} this.result_clear_highlight(); if(results < 1&&searchText.length){ this.update_results_content(""); return this.no_results(searchText); }else{ this.update_results_content(this.results_option_build()); return this.winnow_results_set_highlight(); }}; AbstractChosen.prototype.get_search_regex=function(escaped_search_string){ var regex_anchor; regex_anchor=this.search_contains ? "":"^"; return new RegExp(regex_anchor + escaped_search_string, 'i'); }; AbstractChosen.prototype.search_string_match=function(search_string, regex){ var part, parts, _i, _len; if(regex.test(search_string)){ return true; }else if(this.enable_split_word_search&&(search_string.indexOf(" ") >=0||search_string.indexOf("[")===0)){ parts=search_string.replace(/\[|\]/g, "").split(" "); if(parts.length){ for (_i=0, _len=parts.length; _i < _len; _i++){ part=parts[_i]; if(regex.test(part)){ return true; }} }} }; AbstractChosen.prototype.choices_count=function(){ var option, _i, _len, _ref; if(this.selected_option_count!=null){ return this.selected_option_count; } this.selected_option_count=0; _ref=this.form_field.options; for (_i=0, _len=_ref.length; _i < _len; _i++){ option=_ref[_i]; if(option.selected){ this.selected_option_count +=1; }} return this.selected_option_count; }; AbstractChosen.prototype.choices_click=function(evt){ evt.preventDefault(); if(!(this.results_showing||this.is_disabled)){ return this.results_show(); }}; AbstractChosen.prototype.keyup_checker=function(evt){ var stroke, _ref; stroke=(_ref=evt.which)!=null ? _ref:evt.keyCode; this.search_field_scale(); switch (stroke){ case 8: if(this.is_multiple&&this.backstroke_length < 1&&this.choices_count() > 0){ return this.keydown_backstroke(); }else if(!this.pending_backstroke){ this.result_clear_highlight(); return this.results_search(); } break; case 13: evt.preventDefault(); if(this.results_showing){ return this.result_select(evt); } break; case 27: if(this.results_showing){ this.results_hide(); } return true; case 9: case 38: case 40: case 16: case 91: case 17: break; default: return this.results_search(); }}; AbstractChosen.prototype.clipboard_event_checker=function(evt){ var _this=this; return setTimeout((function(){ return _this.results_search(); }), 50); }; AbstractChosen.prototype.container_width=function(){ if(this.options.width!=null){ return this.options.width; }else{ return "" + this.form_field.offsetWidth + "px"; }}; AbstractChosen.prototype.include_option_in_results=function(option){ if(this.is_multiple&&(!this.display_selected_options&&option.selected)){ return false; } if(!this.display_disabled_options&&option.disabled){ return false; } if(option.empty){ return false; } return true; }; AbstractChosen.prototype.search_results_touchstart=function(evt){ this.touch_started=true; return this.search_results_mouseover(evt); }; AbstractChosen.prototype.search_results_touchmove=function(evt){ this.touch_started=false; return this.search_results_mouseout(evt); }; AbstractChosen.prototype.search_results_touchend=function(evt){ if(this.touch_started){ return this.search_results_mouseup(evt); }}; AbstractChosen.prototype.outerHTML=function(element){ var tmp; if(element.outerHTML){ return element.outerHTML; } tmp=document.createElement("div"); tmp.appendChild(element); return tmp.innerHTML; }; AbstractChosen.browser_is_supported=function(){ if(window.navigator.appName==="Microsoft Internet Explorer"){ return document.documentMode >=8; } if(/iP(od|hone)/i.test(window.navigator.userAgent)){ return false; } if(/Android/i.test(window.navigator.userAgent)){ if(/Mobile/i.test(window.navigator.userAgent)){ return false; }} return true; }; AbstractChosen.default_multiple_text="Select Some Options"; AbstractChosen.default_single_text="Select an Option"; AbstractChosen.default_no_result_text="No results match"; return AbstractChosen; })(); $=jQuery; $.fn.extend({ chosen: function(options){ if(!AbstractChosen.browser_is_supported()){ return this; } return this.each(function(input_field){ var $this, chosen; $this=$(this); chosen=$this.data('chosen'); if(options==='destroy'&&chosen instanceof Chosen){ chosen.destroy(); }else if(!(chosen instanceof Chosen)){ $this.data('chosen', new Chosen(this, options)); }}); }}); Chosen=(function(_super){ __extends(Chosen, _super); function Chosen(){ _ref=Chosen.__super__.constructor.apply(this, arguments); return _ref; } Chosen.prototype.setup=function(){ this.form_field_jq=$(this.form_field); this.current_selectedIndex=this.form_field.selectedIndex; return this.is_rtl=this.form_field_jq.hasClass("chosen-rtl"); }; Chosen.prototype.set_up_html=function(){ var container_classes, container_props; container_classes=["chosen-container"]; container_classes.push("chosen-container-" + (this.is_multiple ? "multi":"single")); if(this.inherit_select_classes&&this.form_field.className){ container_classes.push(this.form_field.className); } if(this.is_rtl){ container_classes.push("chosen-rtl"); } container_props={ 'class': container_classes.join(' '), 'style': "width: " + (this.container_width()) + ";", 'title': this.form_field.title }; if(this.form_field.id.length){ container_props.id=this.form_field.id.replace(/[^\w]/g, '_') + "_chosen"; } this.container=$("
", container_props); if(this.is_multiple){ this.container.html('
    '); }else{ this.container.html('' + this.default_text + '
      '); } this.form_field_jq.hide().after(this.container); this.dropdown=this.container.find('div.chosen-drop').first(); this.search_field=this.container.find('input').first(); this.search_results=this.container.find('ul.chosen-results').first(); this.search_field_scale(); this.search_no_results=this.container.find('li.no-results').first(); if(this.is_multiple){ this.search_choices=this.container.find('ul.chosen-choices').first(); this.search_container=this.container.find('li.search-field').first(); }else{ this.search_container=this.container.find('div.chosen-search').first(); this.selected_item=this.container.find('.chosen-single').first(); } this.results_build(); this.set_tab_index(); return this.set_label_behavior(); }; Chosen.prototype.on_ready=function(){ return this.form_field_jq.trigger("chosen:ready", { chosen: this }); }; Chosen.prototype.register_observers=function(){ var _this=this; this.container.bind('touchstart.chosen', function(evt){ _this.container_mousedown(evt); return evt.preventDefault(); }); this.container.bind('touchend.chosen', function(evt){ _this.container_mouseup(evt); return evt.preventDefault(); }); this.container.bind('mousedown.chosen', function(evt){ _this.container_mousedown(evt); }); this.container.bind('mouseup.chosen', function(evt){ _this.container_mouseup(evt); }); this.container.bind('mouseenter.chosen', function(evt){ _this.mouse_enter(evt); }); this.container.bind('mouseleave.chosen', function(evt){ _this.mouse_leave(evt); }); this.search_results.bind('mouseup.chosen', function(evt){ _this.search_results_mouseup(evt); }); this.search_results.bind('mouseover.chosen', function(evt){ _this.search_results_mouseover(evt); }); this.search_results.bind('mouseout.chosen', function(evt){ _this.search_results_mouseout(evt); }); this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt){ _this.search_results_mousewheel(evt); }); this.search_results.bind('touchstart.chosen', function(evt){ _this.search_results_touchstart(evt); }); this.search_results.bind('touchmove.chosen', function(evt){ _this.search_results_touchmove(evt); }); this.search_results.bind('touchend.chosen', function(evt){ _this.search_results_touchend(evt); }); this.form_field_jq.bind("chosen:updated.chosen", function(evt){ _this.results_update_field(evt); }); this.form_field_jq.bind("chosen:activate.chosen", function(evt){ _this.activate_field(evt); }); this.form_field_jq.bind("chosen:open.chosen", function(evt){ _this.container_mousedown(evt); }); this.form_field_jq.bind("chosen:close.chosen", function(evt){ _this.input_blur(evt); }); this.search_field.bind('blur.chosen', function(evt){ _this.input_blur(evt); }); this.search_field.bind('keyup.chosen', function(evt){ _this.keyup_checker(evt); }); this.search_field.bind('keydown.chosen', function(evt){ _this.keydown_checker(evt); }); this.search_field.bind('focus.chosen', function(evt){ _this.input_focus(evt); }); this.search_field.bind('cut.chosen', function(evt){ _this.clipboard_event_checker(evt); }); this.search_field.bind('paste.chosen', function(evt){ _this.clipboard_event_checker(evt); }); if(this.is_multiple){ return this.search_choices.bind('click.chosen', function(evt){ _this.choices_click(evt); }); }else{ return this.container.bind('click.chosen', function(evt){ evt.preventDefault(); }); }}; Chosen.prototype.destroy=function(){ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action); if(this.search_field[0].tabIndex){ this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex; } this.container.remove(); this.form_field_jq.removeData('chosen'); return this.form_field_jq.show(); }; Chosen.prototype.search_field_disabled=function(){ this.is_disabled=this.form_field_jq[0].disabled; if(this.is_disabled){ this.container.addClass('chosen-disabled'); this.search_field[0].disabled=true; if(!this.is_multiple){ this.selected_item.unbind("focus.chosen", this.activate_action); } return this.close_field(); }else{ this.container.removeClass('chosen-disabled'); this.search_field[0].disabled=false; if(!this.is_multiple){ return this.selected_item.bind("focus.chosen", this.activate_action); }} }; Chosen.prototype.container_mousedown=function(evt){ if(!this.is_disabled){ if(evt&&evt.type==="mousedown"&&!this.results_showing){ evt.preventDefault(); } if(!((evt!=null)&&($(evt.target)).hasClass("search-choice-close"))){ if(!this.active_field){ if(this.is_multiple){ this.search_field.val(""); } $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action); this.results_show(); }else if(!this.is_multiple&&evt&&(($(evt.target)[0]===this.selected_item[0])||$(evt.target).parents("a.chosen-single").length)){ evt.preventDefault(); this.results_toggle(); } return this.activate_field(); }} }; Chosen.prototype.container_mouseup=function(evt){ if(evt.target.nodeName==="ABBR"&&!this.is_disabled){ return this.results_reset(evt); }}; Chosen.prototype.search_results_mousewheel=function(evt){ var delta; if(evt.originalEvent){ delta=evt.originalEvent.deltaY||-evt.originalEvent.wheelDelta||evt.originalEvent.detail; } if(delta!=null){ evt.preventDefault(); if(evt.type==='DOMMouseScroll'){ delta=delta * 40; } return this.search_results.scrollTop(delta + this.search_results.scrollTop()); }}; Chosen.prototype.blur_test=function(evt){ if(!this.active_field&&this.container.hasClass("chosen-container-active")){ return this.close_field(); }}; Chosen.prototype.close_field=function(){ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action); this.active_field=false; this.results_hide(); this.container.removeClass("chosen-container-active"); this.clear_backstroke(); this.show_search_field_default(); return this.search_field_scale(); }; Chosen.prototype.activate_field=function(){ this.container.addClass("chosen-container-active"); this.active_field=true; this.search_field.val(this.search_field.val()); return this.search_field.focus(); }; Chosen.prototype.test_active_click=function(evt){ var active_container; active_container=$(evt.target).closest('.chosen-container'); if(active_container.length&&this.container[0]===active_container[0]){ return this.active_field=true; }else{ return this.close_field(); }}; Chosen.prototype.results_build=function(){ this.parsing=true; this.selected_option_count=null; this.results_data=SelectParser.select_to_array(this.form_field); if(this.is_multiple){ this.search_choices.find("li.search-choice").remove(); }else if(!this.is_multiple){ this.single_set_selected_text(); if(this.disable_search||this.form_field.options.length <=this.disable_search_threshold){ this.search_field[0].readOnly=true; this.container.addClass("chosen-container-single-nosearch"); }else{ this.search_field[0].readOnly=false; this.container.removeClass("chosen-container-single-nosearch"); }} this.update_results_content(this.results_option_build({ first: true })); this.search_field_disabled(); this.show_search_field_default(); this.search_field_scale(); return this.parsing=false; }; Chosen.prototype.result_do_highlight=function(el){ var high_bottom, high_top, maxHeight, visible_bottom, visible_top; if(el.length){ this.result_clear_highlight(); this.result_highlight=el; this.result_highlight.addClass("highlighted"); maxHeight=parseInt(this.search_results.css("maxHeight"), 10); visible_top=this.search_results.scrollTop(); visible_bottom=maxHeight + visible_top; high_top=this.result_highlight.position().top + this.search_results.scrollTop(); high_bottom=high_top + this.result_highlight.outerHeight(); if(high_bottom >=visible_bottom){ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight:0); }else if(high_top < visible_top){ return this.search_results.scrollTop(high_top); }} }; Chosen.prototype.result_clear_highlight=function(){ if(this.result_highlight){ this.result_highlight.removeClass("highlighted"); } return this.result_highlight=null; }; Chosen.prototype.results_show=function(){ if(this.is_multiple&&this.max_selected_options <=this.choices_count()){ this.form_field_jq.trigger("chosen:maxselected", { chosen: this }); return false; } this.container.addClass("chosen-with-drop"); this.results_showing=true; this.search_field.focus(); this.search_field.val(this.search_field.val()); this.winnow_results(); return this.form_field_jq.trigger("chosen:showing_dropdown", { chosen: this }); }; Chosen.prototype.update_results_content=function(content){ return this.search_results.html(content); }; Chosen.prototype.results_hide=function(){ if(this.results_showing){ this.result_clear_highlight(); this.container.removeClass("chosen-with-drop"); this.form_field_jq.trigger("chosen:hiding_dropdown", { chosen: this }); } return this.results_showing=false; }; Chosen.prototype.set_tab_index=function(el){ var ti; if(this.form_field.tabIndex){ ti=this.form_field.tabIndex; this.form_field.tabIndex=-1; return this.search_field[0].tabIndex=ti; }}; Chosen.prototype.set_label_behavior=function(){ var _this=this; this.form_field_label=this.form_field_jq.parents("label"); if(!this.form_field_label.length&&this.form_field.id.length){ this.form_field_label=$("label[for='" + this.form_field.id + "']"); } if(this.form_field_label.length > 0){ return this.form_field_label.bind('click.chosen', function(evt){ if(_this.is_multiple){ return _this.container_mousedown(evt); }else{ return _this.activate_field(); }}); }}; Chosen.prototype.show_search_field_default=function(){ if(this.is_multiple&&this.choices_count() < 1&&!this.active_field){ this.search_field.val(this.default_text); return this.search_field.addClass("default"); }else{ this.search_field.val(""); return this.search_field.removeClass("default"); }}; Chosen.prototype.search_results_mouseup=function(evt){ var target; target=$(evt.target).hasClass("active-result") ? $(evt.target):$(evt.target).parents(".active-result").first(); if(target.length){ this.result_highlight=target; this.result_select(evt); return this.search_field.focus(); }}; Chosen.prototype.search_results_mouseover=function(evt){ var target; target=$(evt.target).hasClass("active-result") ? $(evt.target):$(evt.target).parents(".active-result").first(); if(target){ return this.result_do_highlight(target); }}; Chosen.prototype.search_results_mouseout=function(evt){ if($(evt.target).hasClass("active-result"||$(evt.target).parents('.active-result').first())){ return this.result_clear_highlight(); }}; Chosen.prototype.choice_build=function(item){ var choice, close_link, _this=this; choice=$('
    • ', { "class": "search-choice" }).html("" + (this.choice_label(item)) + ""); if(item.disabled){ choice.addClass('search-choice-disabled'); }else{ close_link=$('', { "class": 'search-choice-close', 'data-option-array-index': item.array_index }); close_link.bind('click.chosen', function(evt){ return _this.choice_destroy_link_click(evt); }); choice.append(close_link); } return this.search_container.before(choice); }; Chosen.prototype.choice_destroy_link_click=function(evt){ evt.preventDefault(); evt.stopPropagation(); if(!this.is_disabled){ return this.choice_destroy($(evt.target)); }}; Chosen.prototype.choice_destroy=function(link){ if(this.result_deselect(link[0].getAttribute("data-option-array-index"))){ this.show_search_field_default(); if(this.is_multiple&&this.choices_count() > 0&&this.search_field.val().length < 1){ this.results_hide(); } link.parents('li').first().remove(); return this.search_field_scale(); }}; Chosen.prototype.results_reset=function(){ this.reset_single_select_options(); this.form_field.options[0].selected=true; this.single_set_selected_text(); this.show_search_field_default(); this.results_reset_cleanup(); this.form_field_jq.trigger("change"); if(this.active_field){ return this.results_hide(); }}; Chosen.prototype.results_reset_cleanup=function(){ this.current_selectedIndex=this.form_field.selectedIndex; return this.selected_item.find("abbr").remove(); }; Chosen.prototype.result_select=function(evt){ var high, item; if(this.result_highlight){ high=this.result_highlight; this.result_clear_highlight(); if(this.is_multiple&&this.max_selected_options <=this.choices_count()){ this.form_field_jq.trigger("chosen:maxselected", { chosen: this }); return false; } if(this.is_multiple){ high.removeClass("active-result"); }else{ this.reset_single_select_options(); } high.addClass("result-selected"); item=this.results_data[high[0].getAttribute("data-option-array-index")]; item.selected=true; this.form_field.options[item.options_index].selected=true; this.selected_option_count=null; if(this.is_multiple){ this.choice_build(item); }else{ this.single_set_selected_text(this.choice_label(item)); } if(!((evt.metaKey||evt.ctrlKey)&&this.is_multiple)){ this.results_hide(); } this.search_field.val(""); if(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex){ this.form_field_jq.trigger("change", { 'selected': this.form_field.options[item.options_index].value }); } this.current_selectedIndex=this.form_field.selectedIndex; evt.preventDefault(); return this.search_field_scale(); }}; Chosen.prototype.single_set_selected_text=function(text){ if(text==null){ text=this.default_text; } if(text===this.default_text){ this.selected_item.addClass("chosen-default"); }else{ this.single_deselect_control_build(); this.selected_item.removeClass("chosen-default"); } return this.selected_item.find("span").html(text); }; Chosen.prototype.result_deselect=function(pos){ var result_data; result_data=this.results_data[pos]; if(!this.form_field.options[result_data.options_index].disabled){ result_data.selected=false; this.form_field.options[result_data.options_index].selected=false; this.selected_option_count=null; this.result_clear_highlight(); if(this.results_showing){ this.winnow_results(); } this.form_field_jq.trigger("change", { deselected: this.form_field.options[result_data.options_index].value }); this.search_field_scale(); return true; }else{ return false; }}; Chosen.prototype.single_deselect_control_build=function(){ if(!this.allow_single_deselect){ return; } if(!this.selected_item.find("abbr").length){ this.selected_item.find("span").first().after(""); } return this.selected_item.addClass("chosen-single-with-deselect"); }; Chosen.prototype.get_search_text=function(){ return $('
      ').text($.trim(this.search_field.val())).html(); }; Chosen.prototype.winnow_results_set_highlight=function(){ var do_high, selected_results; selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result"):[]; do_high=selected_results.length ? selected_results.first():this.search_results.find(".active-result").first(); if(do_high!=null){ return this.result_do_highlight(do_high); }}; Chosen.prototype.no_results=function(terms){ var no_results_html; no_results_html=$('
    • ' + this.results_none_found + ' ""
    • '); no_results_html.find("span").first().html(terms); this.search_results.append(no_results_html); return this.form_field_jq.trigger("chosen:no_results", { chosen: this }); }; Chosen.prototype.no_results_clear=function(){ return this.search_results.find(".no-results").remove(); }; Chosen.prototype.keydown_arrow=function(){ var next_sib; if(this.results_showing&&this.result_highlight){ next_sib=this.result_highlight.nextAll("li.active-result").first(); if(next_sib){ return this.result_do_highlight(next_sib); }}else{ return this.results_show(); }}; Chosen.prototype.keyup_arrow=function(){ var prev_sibs; if(!this.results_showing&&!this.is_multiple){ return this.results_show(); }else if(this.result_highlight){ prev_sibs=this.result_highlight.prevAll("li.active-result"); if(prev_sibs.length){ return this.result_do_highlight(prev_sibs.first()); }else{ if(this.choices_count() > 0){ this.results_hide(); } return this.result_clear_highlight(); }} }; Chosen.prototype.keydown_backstroke=function(){ var next_available_destroy; if(this.pending_backstroke){ this.choice_destroy(this.pending_backstroke.find("a").first()); return this.clear_backstroke(); }else{ next_available_destroy=this.search_container.siblings("li.search-choice").last(); if(next_available_destroy.length&&!next_available_destroy.hasClass("search-choice-disabled")){ this.pending_backstroke=next_available_destroy; if(this.single_backstroke_delete){ return this.keydown_backstroke(); }else{ return this.pending_backstroke.addClass("search-choice-focus"); }} }}; Chosen.prototype.clear_backstroke=function(){ if(this.pending_backstroke){ this.pending_backstroke.removeClass("search-choice-focus"); } return this.pending_backstroke=null; }; Chosen.prototype.keydown_checker=function(evt){ var stroke, _ref1; stroke=(_ref1=evt.which)!=null ? _ref1:evt.keyCode; this.search_field_scale(); if(stroke!==8&&this.pending_backstroke){ this.clear_backstroke(); } switch (stroke){ case 8: this.backstroke_length=this.search_field.val().length; break; case 9: if(this.results_showing&&!this.is_multiple){ this.result_select(evt); } this.mouse_on_container=false; break; case 13: if(this.results_showing){ evt.preventDefault(); } break; case 32: if(this.disable_search){ evt.preventDefault(); } break; case 38: evt.preventDefault(); this.keyup_arrow(); break; case 40: evt.preventDefault(); this.keydown_arrow(); break; }}; Chosen.prototype.search_field_scale=function(){ var div, f_width, h, style, style_block, styles, w, _i, _len; if(this.is_multiple){ h=0; w=0; style_block="position:absolute; left: -1000px; top: -1000px; display:none;"; styles=['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']; for (_i=0, _len=styles.length; _i < _len; _i++){ style=styles[_i]; style_block +=style + ":" + this.search_field.css(style) + ";"; } div=$('
      ', { 'style': style_block }); div.text(this.search_field.val()); $('body').append(div); w=div.width() + 25; div.remove(); f_width=this.container.outerWidth(); if(w > f_width - 10){ w=f_width - 10; } return this.search_field.css({ 'width': w + 'px' }); }}; return Chosen; })(AbstractChosen); }).call(this);